#!/bin/sh

if [ -n "$1" ]; then
    data_date=$1
else
  data_date=$(date -d "-1 days" +%F)
fi

sqoop import \
--connect jdbc:mysql://node101:3306/yk_jtp_app_shujuku \
--username root \
--password 123456 \
--as-textfile \
--delete-target-dir \
--num-mappers 1 \
--target-dir /warehouse/app_basic/t_md_areas/${data_date} \
--fields-terminated-by '\t' \
--null-non-string '\\N' \
--null-string '\\N'
